package com.wcity.manage.service.impl;

import com.wcity.manage.dao.dal.model.PageModel;
import com.wcity.manage.dao.mapper.PayTypeMapper;
import com.wcity.manage.dao.model.Payment;
import com.wcity.manage.service.property.PayTypeService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 缴费类型模块
 * Created by zm on 2016/12/12.
 */
@Service
public class PayTypeServiceImpl implements PayTypeService {

    @Resource private PayTypeMapper payTypeMapper;

    /**
     * 分页查询表单数据
     * @param page
     * @return
     */
    @Override
    public List<Payment> getPayTypeListPage(PageModel<Payment> page) {
        return payTypeMapper.findListPage(page);
    }

    /**
     * 添加数据
     * @param payment
     * @return
     */
    @Override
    public int insertPayType(Payment payment) {
        return payTypeMapper.insert(payment);
    }

    /**
     * 根据id查询缴费类型信息
     * @param id
     * @return
     */
    @Override
    public Payment getPayTypeInfo(String id) {
        return payTypeMapper.getPayTypeInfo(id);
    }

    /**
     * 修改
     * @param payment
     * @return
     */
    @Override
    public int updateUser(Payment payment) {
        return payTypeMapper.update(payment);
    }

    /**
     * 删除
     * @param id
     * @return
     */
    @Override
    public int payTypeDelect(String id) {
        return payTypeMapper.delete(id);
    }
}
